package service.serviceImpl;

import dao.LogMapper;
import dao.daoImpl.LogMapperImpl;
import pojo.Department;
import pojo.Log;
import pojo.LogFamily;
import pojo.User;
import service.LogService;

import java.sql.SQLException;
import java.util.List;

/**
 * Created by Administrator on 2017-11-26.
 */
public class LogServiceImpl implements LogService {
    LogMapper logMapper=new LogMapperImpl();;
    @Override
    public List<LogFamily> getLogFamily() throws SQLException {

        return logMapper.getLogFamily();
    }

    @Override
    public int writeLog(Log log) throws SQLException {

        return logMapper.writeLog(log);
    }

    @Override
    public List<Log> getAllLog(Integer id) throws SQLException {
        return logMapper.getAllLog(id);
    }

    @Override
    public int getCount(Integer id) {
        return 0;
    }

    @Override
    public List<Log> getCurrentLog(Integer id, int pageNow, int i) throws SQLException {
        return logMapper.getCurrentLog(id,pageNow,i);
    }

    @Override
    public Log lookCurrentLog(int id) throws SQLException {
        return logMapper.lookCurrentLog(id);
    }

    @Override
    public int updateLog(Log log) throws SQLException {
        return logMapper.againSubmit(log);
    }

    @Override
    public int deleteLog(int id) throws SQLException {
        return logMapper.deleteLog(id);
    }

    @Override
    public List<Log> getDoubleConditionLog(Integer id, int pageNow, int pageSize, String logFamily, String logStatus) throws SQLException {
        return logMapper.getDoubleConditionLog(id,pageNow,pageSize,logFamily,logStatus);
    }

    @Override
    public List<Log> getFirstConditionLog(Integer id, int pageNow, int pageSize, String logFamily) throws SQLException {
        return logMapper.getFirstConditionLog(id,pageNow,pageSize,logFamily);
    }

    @Override
    public List<Log> getSecondConditionLog(Integer id, int pageNow, int pageSize, String logStatus) throws SQLException {
        return logMapper.getSecondConditionLog(id,pageNow,pageSize,logStatus);
    }



    @Override
    public List<Log> getAllLogByLogFamilyAndLogStatus(Integer id, String logFamily, String logStatus) throws SQLException {
        return logMapper.getAllLogByLogFamilyAndLogStatus(id,logFamily,logStatus);
    }

    @Override
    public List<Log> getAllLogByLogFamily(Integer id, String logFamily) throws SQLException {
        return logMapper.getAllLogByLogFamily(id,logFamily);
    }

    @Override
    public List<Log> getAllLogByLogStatus(Integer id, String logStatus) throws SQLException {
        return logMapper.getAllLogByLogStatus(id,logStatus);
    }

    @Override
    public List<Log> checkAllLog(String logStatus, String department) throws SQLException {
        return logMapper.checkAllLog(logStatus,department);
    }

    @Override
    public List<Log> checkLog(String logStatus,String department, int pageNow,int pageSize) throws SQLException {
        return logMapper.checkLog(logStatus,department,pageNow,pageSize);
    }

    @Override
    public Log getLog(int id) throws SQLException {
        return logMapper.getLogById(id);
    }

    @Override
    public int check(int id, String logStatus) throws SQLException {
        return logMapper.check(id,logStatus);
    }

    @Override
    public List<Log> getPassLog(String logStatus) throws SQLException {
        return logMapper.getPassLog(logStatus);
    }

    @Override
    public List<Log> getCurrentPassLog(String logStatus,String department, int pageNow, int pageSize) throws SQLException {
        return logMapper.getCurrentPassLog(logStatus,department,pageNow,pageSize);
    }

    @Override
    public List<Log> getFirstConditionCurrentPassLog(String logStatus,String department, String logFamily, int pageNow, int pageSize) throws SQLException {
        return logMapper.getFirstConditionCurrentPassLog(logStatus,department,logFamily,pageNow,pageSize);
    }

    @Override
    public List<Log> getPassLogByLogFamily(String logFamily,String department, String logStatus) throws SQLException {
        return logMapper.getPassLogByLogFamily(logFamily,department,logStatus);
    }

    @Override
    public List<Department> selectDepartment() throws SQLException {
        return logMapper.selectDepartment();
    }
    @Override
    public List<Log> selectAllLog() throws SQLException {
        return logMapper.selectAllLog();
    }

    @Override
    public List<Log> getCurrentAllLog(int pageNow, int page_size)throws SQLException {
        return logMapper.getCurrentAllLog(pageNow,page_size);
    }

    @Override
    public List<Log> selectAllLogByDoubleCondition(String department, String logFamily)throws SQLException {
        return logMapper.selectAllLogByDoubleCondition(department,logFamily);
    }

    @Override
    public List<Log> getCurrentLogByDepartmentAndLogFamily(String department, String logFamily, int pageNow, int page_size)throws SQLException {
        return logMapper.getCurrentLogByDepartmentAndLogFamily(department,logFamily,pageNow,page_size);
    }

    @Override
    public List<Log> selectAllLogByFirstCondition(String department)throws SQLException {
        return logMapper.selectAllLogByFirstCondition(department);
    }

    @Override
    public List<Log> getCurrentLogByDepartment(String department, int pageNow, int page_size)throws SQLException {
        return logMapper.getCurrentLogByDepartment(department,pageNow,page_size);
    }

    @Override
    public List<Log> selectAllLogBySecoundCondition(String logFamily)throws SQLException {
        return logMapper.selectAllLogBySecoundCondition(logFamily);
    }

    @Override
    public List<Log> getCurrentLogByLogFamily(String logFamily, int pageNow, int page_size)throws SQLException {
        return logMapper.getCurrentLogByLogFamily(logFamily,pageNow,page_size);
    }

    @Override
    public List<LogFamily> selectLogFamily() throws SQLException {
        return logMapper.selectLogFamily();
    }



}
